<template>
  <div>
    <div class="tag">
      <div class="tag-name">{{name}}</div>
      <div class="tag-list">
        <div v-for="(item,index) in tag" :key="index" :class="{'isactive':selectTag == item}" class="tag-list" @click="handle(item)">
          {{item}}
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    name: String,
    tag: Array,
    selectTag: String
  },
  name: 'TabTag',
  methods: {
    handle (item) {
      this.$emit('checkTag', item)
    }
  }
}
</script>
<style  scoped>
.tag {
  display: flex;
  text-align: center;
  align-items: center;
  padding: 0.3rem 0;
}
.tag-list {
  /* display: flex; */
  float: left;
  flex: 7;
  margin-left: 0.2rem;
}
.tag-name {
  text-align: right;
  flex: 1.5;
  font-weight: bold;
}
.tag-list div {
  border: solid #ccc 0.05rem;
  text-align: center;
  justify-content: center;
  width: 1.5rem;
  padding: 0.08rem;
  border-radius: 0.1rem;
}
.isactive {
  color: #2395ff !important;
  background: #eef7ff !important;
  border-color: rgba(35, 149, 255, 0.18) !important;
}
</style>
